package ClassTest;

/**
 * Created by 春旺 on 2017/9/24.
 */
public class NumberChoose {
    public int min (int [] data){
        int min = data[0];

        for (int index = 0; index < data.length; index++)

        {
                if (min >= data[index])
                    min = data[index];
        }
        return min;
    }
    public int max (int [] data){

        int max = data[0];
        for (int index = 0; index < data.length; index++)
        {
            if (max <= data[index])
                max = data[index];
        }
        return max;
    }

}
